#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 crane <crane@gosun>
#
# Distributed under terms of the MIT license.

"""
https://www.lintcode.com/problem/gas-station/description


"""

class Solution:
    """
    @param gas: An array of integers
    @param cost: An array of integers
    @return: An integer
    """
    def canCompleteCircuit(self, gas, cost):
        # write your code here
        prefix_gas_sum = self.prefix_sum(gas)
        prefix_cost_sum = self.prefix_sum(cost)

        self.calc()

    def prefix_sum(self, nums):
        prefix_sums = len(nums) * [None]

        cur_sum = 0     # 类似于哨兵的作用

        for idx in range(nums):
            cur_sum = cur_sum + nums[idx]
            prefix_sums[idx] = cur_sum

        return prefix_sums

    def calc(self):
        pass


def test():
    s = Solution()

def main():
    print("start main")
    test()

if __name__ == "__main__":
    main()
